<template>
  <div class="progress-chart" ref="ProgressChartRef">ProgressChart</div>
</template>

<script lang="ts">
export default {
  name: "ProgressChart",
};
</script>

<script lang="ts" setup>
import { ref, onMounted } from "vue";
import * as echarts from "echarts";

const ProgressChartRef = ref();
onMounted(() => {
  const myEchart = echarts.init(ProgressChartRef.value);
  const option = {
    xAxis: {
      show: false,
      min: 0,
      max: 100,
    },
    yAxis: {
      data: ["进度"],
      show: false,
    },
    series: {
      type: "bar",
      data: ["30"],
      barWidth: 10, //柱条宽度
      showBackground: true, //显示背景色
      itemStyle: {
        color: "skyBlue", //柱条颜色
      },
      label: {
        //显示内容
        show: true,
        formatter: "|",
        position: "right",
        color: "skyBlue",
      },
    },
    grid: {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0,
    },
  };
  myEchart.setOption(option);
});
</script>

<style scoped>
.progress-chart {
  width: 100%;
  height: 100%;
}
</style>
